package com.zhongjian.technologycal.mall.http;

import com.zhongjian.technologycal.mall.bean.CodeBean;
import com.zhongjian.technologycal.mall.bean.LoginBean;
import com.zhongjian.technologycal.mall.bean.RegisterUserBean;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.Url;
import rx.Observable;

/**
 * Created by
 *
 */
public interface MyApiService {

    @POST("v1/LoginAndRegister/UserLogin")
    Observable<LoginBean> jsonLoginSystem(
            @Body RequestBody jsonStr);

    @POST("v1/LoginAndRegister/SendRegisterVerifyCode")
    Observable<CodeBean> jsonSendCode(
            @Body RequestBody jsonStr);

    @POST("v1/LoginAndRegister/RegisterUser")
    Observable<RegisterUserBean> jsonRegisterUser(
            @Body RequestBody jsonStr);

    @POST("v1/LoginAndRegister/logout")
    Observable<LoginBean> jsonLoginOut(
            @Body RequestBody jsonStr);

    @POST("v1/LoginAndRegister/modifyPassword")
    Observable<LoginBean> jsonModifyPassword(
            @Body RequestBody jsonStr);

    @GET
    Observable<ResponseBody> executeGet(
            @Url String url
    );

    //分类
    @GET
    Observable<ResponseBody> executeCategoryGet(
            @Url String url
    );

    //首页
    @GET
    Observable<ResponseBody> executeHomeGet(
            @Url String url
    );


    @GET
    Observable<LoginBean> jsonAddressList(
            @Url String url);

    //添加地址
    @POST("v1/AddressManager/addAddressByUser")
    Observable<LoginBean> jsonAddAddress(
            @Body RequestBody jsonStr);

    //首页上商品数据
    @GET("v1/HomePage/initHomePage")
    Observable<ResponseBody> getHomePage(
            @Query("productNum") int num);

    //商品详情数据
    @GET("v1/ProductManager/getProductDetails")
    Observable<ResponseBody> getProductDetails(
            @Query("productId") int productId);

    //会员专区列表数据
    @GET("v1/HomePage/MemberArea")
    Observable<ResponseBody> getMembersAreaList(
            @Query("type") int productId,
            @Query("page") int page,
            @Query("pageNum") int pageNum);

    //会员专区列表数据
    @GET("v1/HomePage/AreaProducts")
    Observable<ResponseBody> getMembersAreaListTag(
            @Query("tag") int tag,
            @Query("type") int productId,
            @Query("page") int page,
            @Query("pageNum") int pageNum);

    //获取默认地址
    @POST("v1/AddressManager/getDefaultAddressOfUser")
    Observable<ResponseBody> postDefaultAddressOfUser(
            @Query("token") String token);

    //获取二级分类商品
    @GET("v1/ProductManager/getProductOfCategory/{SubCategoryId}")
    Observable<ResponseBody> getDefaultUrlChild(
            @Path("SubCategoryId") int SubCategoryId,
            @Query("type") int type,
            @Query("page") int page,
            @Query("pageNum") int pageNum
    );


    //获取订单数据
    @GET("v1/PersonalCenter/getOrder/{token}/{type}")
    Observable<ResponseBody> getDefaultUrlOrderList(
            @Path("token") String token,
            @Path("type") String type,
            @Query("page") int page,
            @Query("pageNum") int pageNum
    );

    //获取我的购物车数据
    @GET("v1/PersonalCenter/PersonalCenter/getShoppingCartInfo")
    Observable<ResponseBody> getDefaultUrlCartList(
            @Query("token") String token
    );

    //生成购物车订单
    @POST("v1/PersonalCenter/createBOrder/{token}")
    Observable<ResponseBody> getDefaultUrlOrderCommit(
            @Path("token") String token,
            @Body RequestBody jsonStr
    );

    //设置昵称
    @POST("v1/PersonalCenter/updateNickName/{token}")
    Observable<ResponseBody> postDefaultUrlNickname(
            @Path("token") String token,
            @Query("nickName") String nickname
    );

    //设置推荐人
    @POST("v1/PersonalCenter/updateInviteCode/{token}")
    Observable<ResponseBody> postDefaultUrlInviteCode(
            @Path("token") String token,
            @Query("inviteCode") String inviteCode
    );

    //获取个人中心数据
    @GET("v1/PersonalCenter/initPersonalCenterData/{token}")
    Observable<ResponseBody> getDefaultUrlCenterData(
            @Path("token") String token
    );

    //生成VIP订单
    @POST("v1/MemberShip/createVOrder/{token}")
    Observable<ResponseBody> postDefaultUrlVipOrder(
            @Path("token") String token,
            @Query("type") int inviteCode,
            @Query("lev") int level
    );

    //分流记录
    @GET("v1/MemberShip/SplitStreamRecord/{token}")
    Observable<ResponseBody> getDefaultUrlSplitStreamRecord(
            @Path("token") String token
    );

    //转让现金币
    @POST("v1/MemberShip/TransferOfMoney/{token}")
    Observable<ResponseBody> postDefaultUrlOfMoney(
            @Path("token") String token,
            @Query("money") double money,
            @Query("sysID") int sysID
    );

    //查看粉丝具体信息
    @GET("v1/MemberShip/GetFansDetails/{token}")
    Observable<ResponseBody> getDefaultUrlFans(
            @Path("token") String token,
            @Query("type") String type,
            @Query("page") int page,
            @Query("pageNum") int pageNum
    );

    //充值现金币
    @POST("v1/MemberShip/createCOrder/{token}")
    Observable<ResponseBody> postDefaultUrlMemberShip(
            @Path("token") String token,
            @Query("money") double money

    );

    //二送一查看赠送名额
    @GET("v1/MemberShip/GetPresent/{token}")
    Observable<ResponseBody> getDefaultUrlPresenter(
            @Path("token") String token,
            @Query("type") int type
    );

    //立即赠送名额
    @POST("v1/MemberShip/GivePresentPromptly/{token}")
    Observable<ResponseBody> postDefaultUrlPresenterPromptly(
            @Path("token") String token,
            @Query("passiveUserId") int passiveUserId,
            @Query("sendHeadId") int sendHeadId
    );

    //验证码动态登录
    @POST("v1/LoginAndRegister/dynamicLogin")
    Observable<ResponseBody> postDefaultUrldynamicLogin(
            @Body RequestBody jsonStr
    );

    //根据众健号搜索用户
    @GET("v1/MemberShip/getMemberBySysId/{token}")
    Observable<ResponseBody> getDefaultUrlMemberBySysId(
            @Path("token") String token,
            @Query("SysID") int SysID
    );

    //金额明细 type：coupon points vip   elec 红包 购物币  积分  现金币
    @GET("v1/PersonalCenter/accountBill/{token}")
    Observable<ResponseBody> getDefaultUrlAccountBill(
            @Path("token") String token,
            @Query("type") String type,
            @Query("page") int page,
            @Query("pageNum") int pageNum
    );

    //更新头像
    @POST("v1/PersonalCenter/updateHeadPhoto/{token}")
    Observable<ResponseBody> postDefaultUrlUpload(
            @Path("token") String token,
            @Query("headPhoto") String headPhoto
    );

    //上传图片
    @Multipart
    @POST("v1/upload")
    Observable<ResponseBody> postDefaultUrlUploadPhoto(
            @Part MultipartBody.Part file,
            @Query("token") String token

    );

    //实名认证
    @POST("v1/PersonalCenter/PostCertificationInfo/{token}")
    Observable<ResponseBody> postDefaultUrlRealName(
            @Path("token") String token,
            @Body RequestBody jsonStr
    );

    //实名认证界面
    @GET("v1/PersonalCenter/GetCertificationInfo/{token}")
    Observable<ResponseBody> getDefaultUrlByInfo(
            @Path("token") String token
    );

    //申请代理
    @POST("v1/MemberShip/addProxyApply/{token}")
    Observable<ResponseBody> postDefaultUrlApplyProxy(
            @Path("token") String token,
            @Body RequestBody jsonStr
    );

    //实名认证界面
    @GET("v1/AccountManager/AccountManager/GetAllAccount/{token}")
    Observable<ResponseBody> getDefaultUrlByGetAllAccount(
            @Path("token") String token
    );

    //添加支付宝账号
    @POST("v1/AccountManager/AccountManager/AddAliAccount/{token}")
    Observable<ResponseBody> postDefaultUrlAddAliAccount(
            @Path("token") String token,
            @Query("account") String account,
            @Query("name") String name
    );

    //支付宝现金币提现
    @POST("v1/PersonalCenter/TxElecNum/{token}")
    Observable<ResponseBody> postDefaultUrlElecMoney(
            @Path("token") String token,
            @Query("money") double money,
            @Query("txType") String txType,
            @Query("cardNo") String cardNo,
            @Query("trueName") String trueName
    );

    //银行卡现金币提现
    @POST("v1/PersonalCenter/TxElecNum/{token}")
    Observable<ResponseBody> postDefaultUrlBankElecMoney(
            @Path("token") String token,
            @Query("money") double money,
            @Query("txType") String txType,
            @Query("cardNo") String cardNo,
            @Query("trueName") String trueName,
            @Query("bankName") String bankName,
            @Query("bankInfo") String bankInfo
    );

    //支付密码校验
    @POST("v1/PersonalCenter/verifyPayPassword")
    Observable<ResponseBody> postDefaultUrlPayPassword(
            @Query("toKen") String token,
            @Query("payPassword") String payPassword
    );

    //支付密码设置校验验证码
    @POST("v1/LoginAndRegister/verify")
    Observable<ResponseBody> postDefaultUrlVerify(
            @Body RequestBody jsonStr

    );

    //支付密码设置
    @POST("v1/LoginAndRegister/verify/{payPasswordCertificate}")
    Observable<ResponseBody> postDefaultUrlSettingPayPassword(
            @Path("payPasswordCertificate") String payPasswordCertificate,
            @Body RequestBody jsonStr

    );

    //分流
    @POST("v1/MemberShip/SplitStream/{token}")
    Observable<ResponseBody> postDefaultUrlSplitStream(
            @Path("token") String token,
            @Query("toUserId") int toUserId,
            @Query("type") int type

    );

    //初始化代理申请页面
    @GET("v1/MemberShip/initProxyApply/{token}")
    Observable<ResponseBody> getDefaultUrlProxyApply(
            @Path("token") String token
    );

    //会员升级界面初始数据
    @GET("v1/MemberShip/entrance/{token}")
    Observable<ResponseBody> getDefaultUrlEntrance(
            @Path("token") String token
    );

    //忘记密码
    @POST("v1/LoginAndRegister/forgetPassword")
    Observable<ResponseBody> postDefaultUrlForgetPassword(
            @Body RequestBody jsonStr

    );

    //直接升级
    @POST("v1/MemberShip/directUpdate/{token}")
    Observable<ResponseBody> postDefaultUrlUpdate(
            @Path("token") String token,
            @Query("type") int type

    );

    //获取支持的最低版本基数
    @GET("appNeedUpdate")
    Observable<ResponseBody> getDefaultUrlVersion(
            @Query("appCurrentVersion") String appCurrentVersion

    );

    //查看粉丝数量
    @GET("v1/MemberShip/GetFans/{token}")
    Observable<ResponseBody> getDefaultUrlGetFans(
            @Path("token") String token
    );

    //手机号更换校验验证码
    @POST("v1/LoginAndRegister/verifyUpdateUserName")
    Observable<ResponseBody> postDefaultUrlUpdataUserName(
            @Body RequestBody jsonStr

    );

    //手机号更换设置
    @POST("v1/LoginAndRegister/verifyUpdateUserName/{payPasswordCertificate}")
    Observable<ResponseBody> postDefaultUrlUpdataUserNamePhone(
            @Path("payPasswordCertificate") String payPasswordCertificate,
            @Query("token") String token,
            @Query("verifyCode") String verifyCode,
            @Query("userName") String userName

    );

    //t通过关键字搜索产品
    @POST("v1/ProductManager/searchProduct")
    Observable<ResponseBody> postDefaultUrlSearchProduct(
            @Query("key") String key

    );

    //子订单支付
    @POST("v1/PersonalCenter/HandleEOrder/{token}")
    Observable<ResponseBody> postDefaultUrlGetHandlePayOrder(
            @Path("token") String token,
            @Query("orderNo") String orderNo
    );

    //同步处理支付父订单
    @POST("v1/PersonalCenter/syncHandleOrderC/{token}")
    Observable<ResponseBody> postDefaultUrlGetHandlePayOrderC(
            @Path("token") String token,
            @Query("orderNoC") String orderNoC
    );

    //取消订单
    @POST("v1/PersonalCenter/cancelOrder/{token}")
    Observable<ResponseBody> postDefaultUrlCancelOrder(
            @Path("token") String token,
            @Query("orderNo") String orderNo
    );

    //获取订单详情
    @GET("v1/PersonalCenter/getOrderDetails/{token}/{orderId}")
    Observable<ResponseBody> getDefaultUrlOrderDetails(
            @Path("token") String token,
            @Path("orderId") int orderId

    );

    //加入购物车
    @POST("v1/PersonalCenter/updateShoppingCartInfo/{productId}/{SpecId}")
    Observable<ResponseBody> postDefaultUrlCartInfo(
            @Path("productId") int productId,
            @Path("SpecId") int SpecId,
            @Query("token") String token,
            @Query("productNum") int productNum
    );

    //投诉建议
    @POST("v1/PersonalCenter/ComplaintAndAdvice/{token}")
    Observable<ResponseBody> postDefaultUrlAdvice(
            @Path("token") String token,
            @Query("memo") String memo
    );

    //购物车具体物品数量更新
    @POST("v1/PersonalCenter/updateShoppingCartInfo/{shoppingCartId}")
    Observable<ResponseBody> postDefaultUrlUpdateCartInfoNum(
            @Path("shoppingCartId") int shoppingCartId,
            @Query("token") String token,
            @Query("productNum") int productNum
    );

    //删除购物车数据
    @POST("v1/PersonalCenter/delShoppingCartInfo")
    Observable<ResponseBody> postDefaultUrlDelShoppingCartInfo(
            @Query("token") String token,
            @Query("shoppingCartId") int shoppingCartId
    );

    //红包活动判断
    @GET("getBeginningRedPacketKey")
    Observable<ResponseBody> getDefaultUrlOGetBeginningRedPacketKey(
            @Query("token") String token

    );

    //红包领取
    @POST("drawRedPacket")
    Observable<ResponseBody> postDefaultUrldrawRedPacket(
            @Query("token") String token,
            @Query("redPacketKey") String redPacketKey
    );

    //申请退款
    @POST("v1/PersonalCenter/ApplyRefund/{token}")
    Observable<ResponseBody> postDefaultUrlApplyRefund(
            @Path("token") String token,
            @Query("orderNo") String orderNo,
            @Query("memo") String memo
    );

    //申请退货
    @POST("v1/PersonalCenter/ApplySaleReturn/{token}")
    Observable<ResponseBody> postDefaultUrlApplySaleReturn(
            @Path("token") String token,
            @Query("orderNo") String orderNo,
            @Query("memo") String memo,
            @Query("photo1") String photo1,
            @Query("photo2") String photo2,
            @Query("photo3") String photo3

    );

    //确认收货
    @POST("v1/PersonalCenter/confirmOrder/{token}")
    Observable<ResponseBody> postDefaultUrlconfirmOrder(
            @Path("token") String token,
            @Query("orderNo") String orderNo
    );

    //查询账户所有币值余额
    @GET("v1/PersonalCenter/GetPersonalAccountBalance/{token}")
    Observable<ResponseBody> getDefaultUrlAccountBalance(
            @Path("token") String token
    );

    //查看物流
    @POST("v1/PersonalCenter/getLogisticsInformation/{token}")
    Observable<ResponseBody> postDefaultUrlLogisticsInformation(
            @Path("token") String token,
            @Query("orderNo") String orderNo
    );

    //获取目前支持的银行
    @GET("v1/AccountManager/AccountManager/GetAllBank")
    Observable<ResponseBody> getDefaultUrlGetAllBank(
    );

    //添加银行卡
    @POST("v1/AccountManager/AccountManager/AddBankAccount/{token}")
    Observable<ResponseBody> postDefaultUrlAddBankAccount(
            @Path("token") String token,
            @Query("account") String account,
            @Query("bankName") String bankName,
            @Query("bankInfo") String bankInfo,
            @Query("bankLogo") String bankLogo,
            @Query("name") String name
    );

    //删除支付宝账号
    @POST("v1/AccountManager/AccountManager/DeleteAliAccount/{token}")
    Observable<ResponseBody> postDefaultUrlDeleteAliAccount(
            @Path("token") String token,
            @Query("id") int id

    );

    //删除银行卡账号
    @POST("v1/AccountManager/AccountManager/DeleteBankAccount/{token}")
    Observable<ResponseBody> postDefaultUrlDeleteBankAccount(
            @Path("token") String token,
            @Query("id") int id

    );

    //删除收货地址
    @POST("v1/AddressManager/deleteAddressById")
    Observable<ResponseBody> postDefaultUrldeleteAddressById(
            @Body RequestBody jsonStr

    );

    //现金支付处理vip
    @POST("v1/MemberShip/syncHandleVipOrder/{token}")
    Observable<ResponseBody> postDefaultUrlsyncHandleVipOrder(
            @Path("token") String token,
            @Query("orderNo") String orderNo

    );

    /**
     * ******************************
     * @return
     * 商学院相关接口
     * 获取目前支持的银行
     * 商学院首页数据
     */
    @GET("v2/commercialcollege/homepage")
    Observable<ResponseBody> getDefaultUrlCommercialcollegeHomePage(

    );

    //查看具体课程类型的课
    @GET("v2/commercialcollege/coursesbytype")
    Observable<ResponseBody> getDefaultUrlCommercialcollegeCoursesbytype(
            @Query("type") int type,
            @Query("page") int page,
            @Query("pageNum") int pageNum
    );

    //课程详细简介
    @GET("v2/commercialcollege/coursedetailbrief")
    Observable<ResponseBody> getDefaultUrlCoursedetailbrief(
            @Query("courseid") int courseid

    );

    //课程详细目录
    @GET("v2/commercialcollege/coursedetailcatalog")
    Observable<ResponseBody> getDefaultUrlCoursedetailcatalog(
            @Query("courseid") int courseid

    );

    //
    //课程详细讲师
    @GET("v2/commercialcollege/coursedetaillecturer")
    Observable<ResponseBody> getDefaultUrlCoursedetaillecturer(
            @Query("courseid") int courseid

    );

    //课程详细主页
    @GET("v2/commercialcollege/coursedetailmain")
    Observable<ResponseBody> getDefaultUrlCoursedetailsMain(
            @Query("courseid") int courseid

    );

    //课程图文详情
    @GET("v2/commercialcollege/coursehtmltext")
    Observable<ResponseBody> getDefaultUrlCoursedetailsHtml(
            @Query("courseid") int courseid

    );

    //我的课程列表
    @GET("v2/commercialcollege/myCourses/{token}")
    Observable<ResponseBody> getDefaultUrlMyCourse(
            @Path("token") String token,
            @Query("type") String type,
            @Query("page") int page,
            @Query("pageNum") int pageNum
    );

    //课程报名
    @POST("v2/commercialcollege/signupforcourse/{token}")
    Observable<ResponseBody> postDefaultUrlSignupforcourse(
            @Path("token") String token,
            @Query("courseId") int courseId,
            @Query("elecnum") double elecnum,
            @Query("realpay") double realpay

    );
    //商学院课程同步支付
    @POST("v2/commercialcollege/synchandleordercc/{token}")
    Observable<ResponseBody> postDefaultUrlSynchandleordercc(
            @Path("token") String token,
            @Query("orderNo") String orderNo

    );
    //课程是否已经报名
    @GET("v2/commercialcollege/courseissignup/{token}")
    Observable<ResponseBody> getDefaultUrlCourseissignup(
            @Path("token")String token,
            @Query("courseid") int courseid

    );
    /**
     * **************************************************
     * 团购秒杀
     */





}
